using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Web.Core.Providers;

namespace Web.Core.Objects
{
    public class Advertisements
    {
        public static ArrayList GetAllAdvertisements(int pageNumber, int pageSize)
        {
            return DataProvider.GetInstance().GetAllAdvertisements(pageNumber, pageSize);
        }
        public static ArrayList GetAllAds()
        {
            return DataProvider.GetInstance().GetAdvertisements(new Advertisement(0, "", ""));
        }
        public static Advertisement GetAdvertisementsByID(int aID)
        {
            return DataProvider.GetInstance().GetAdvertisements(new Advertisement(aID, "", ""))[0] as Advertisement;
        }
        public static int InsertAdvertisement(Advertisement ads)
        {
            return DataProvider.GetInstance().CreateUpdateDeleteAdvertisements(ads, GlobalStorage.Action.Insert);
        }

        public static int UpdateAdvertisement(Advertisement ads)
        {
            return DataProvider.GetInstance().CreateUpdateDeleteAdvertisements(ads, GlobalStorage.Action.Update);
        }

        public static int DeleteAdvertisement(Advertisement ads)
        {
            return DataProvider.GetInstance().CreateUpdateDeleteAdvertisements(ads, GlobalStorage.Action.Delete);
        }      
    }
}
